package com.ymatou.iapi.idcardquery.service;

import org.json.JSONObject;

import com.ymatou.iapi.idcardquery.resp.GetManageBuyerIdCardInfosResp;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*根据买家id查询身份证信息接口Call
*FreeMaker Template自动生成代码
*/
public class GetManageBuyerIdCardInfosCall extends YmatouBaseCall {
	private static String opurl = "manage/GetManageBuyerIdCardInfos";

	public GetManageBuyerIdCardInfosCall() {
		super(EnvSetup.getSystemUrl("idcardquery"), opurl, "POST", "JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept",
				"text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}

	/**
	 * 获取Data
	 * 
	 * @return
	 */
	public Object getData() {
		Object Data = null;
		try {
			Data = new JSONObject(getReturnData()).get("data");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Data;
	}

	public GetManageBuyerIdCardInfosResp getManageBuyerIdCardInfosResp() {
		return (GetManageBuyerIdCardInfosResp) FormatUtil.GSONToObject(
				getData().toString(), GetManageBuyerIdCardInfosResp.class);
	}

}